#include "pch.h"
#include <comdef.h>

// COM组件接口唯一标识
_declspec(selectany) IID IID_TESTCOM = {
	0x4adf0212,
	0x5758,
	0x4a8e,
	{ 0x99, 0xaf, 0x18, 0x37, 0x23, 0x4a, 0x16, 0xc5 }
};
static const WCHAR* IID_TESTCOM_STR = L"{4ADF0212-5758-4A8E-99AF-1837234A16C5}";

// COM组件接口
__interface
	__declspec(uuid("4ADF0212-5758-4A8E-99AF-1837234A16C5"))
	ITestComInterface : public IUnknown
{
	// Windows信息获取

	STDMETHOD(GetCpuUsedRate)(UINT16 *rate) PURE;
	STDMETHOD(GetCpuCoresNum)(UINT32 *num) PURE;
	STDMETHOD(GetMemTotalSize)(UINT64 *size) PURE;	// byte
	STDMETHOD(GetMemFreeSize)(UINT64* size) PURE;	// byte
	STDMETHOD(GetBatteryEnergyRemaining)(UINT16 *percent) PURE;

	// STDMETHOD 展开
	// virtual __declspec(nothrow) HRESULT __stdcall GetCpuUsedRate(UINT16* rate) = 0;
};